﻿@model ContactManagement.Models.DynamicData.DynamicDataListModel
@{
    ViewBag.Title = Resources.PageTitles.DynamicDataTypeManagementRESX;
}
<h2>@Resources.PageTitles.DynamicDataTypeManagementRESX</h2>
<p>
    @Html.ActionLink(Resources.Navigation.CreateRESX, EActionDynamicData.DynamicDataTypeAdd.ToString())
</p>
<div>
    @Html.ValidationSummary(true)
    @Html.ShowCustomMessage()
</div>
<table class="@WebConstants.FilterTableRowsCssClass">
    <thead>
        <tr>
            <th>
                @Resources.AccountViews.OptionsRESX
            </th>
            <th>
                @Html.TableHeaderLinks("Name", Resources.AdminViews.DynamicDataNameRESX).CreateSortLink()
            </th>
            <th>
                @Html.TableHeaderLinks("DynamicDataType", Resources.AdminViews.DynamicDataTypeRESX).CreateSortLink()
            </th>
            <th>
                @Html.TableHeaderLinks("Module", Resources.AdminViews.DynamicDataAssignedModuleRESX).CreateSortLink()
            </th>
            <th>
                @Html.TableHeaderLinks("DynamicDataTypeCategory", Resources.AdminViews.DynamicDataAssignedCategoryRESX).CreateSortLink()
            </th>
            <th>
                @Html.TableHeaderLinks("HasUserGroups", Resources.AdminViews.DynamicDataGroupRightsAssignedRESX).CreateSortLink()
            </th>
            <th>
                @Html.TableHeaderLinks("IsVisible", Resources.AdminViews.IsVisibleRESX).CreateSortLink()
            </th>
            <th>
                @Html.TableHeaderLinks("IsRequired", Resources.AdminViews.IsRequiredRESX).CreateSortLink()
            </th>
            <th>
                @Html.TableHeaderLinks("SortId", Resources.AdminViews.SortIDRESX).CreateSortLink()
            </th>
        </tr>
    </thead>
    <tbody>
        @foreach (var item in Model.DynamicDataTypes)
        {
            <tr>
                <td>
                    @Html.ActionLink(Resources.Navigation.EditRESX, EActionDynamicData.DynamicDataTypeEdit.ToString(), new { id = item.ID })
                    |
                    @Html.ActionLink(Resources.Navigation.DynamicDataEditGroupRightsRESX, EActionDynamicData.EditGroupRights.ToString(), new { id = item.ID })
                    |
                    @Html.ActionLink(Resources.Navigation.DeleteRESX, EActionDynamicData.DynamicDataTypeDelete.ToString(), new { id = item.ID })
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Name)
                </td>
                <td>
                    @item.GetDynamicDataTypeName()
                </td>
                <td>
                    @EFDataModel.EFBase.GetModuleName(item.Module)
                </td>
                <td>
                    @Html.Categories().DisplayForCategory(item.DynamicDataTypeCategoryID.ToString())
                </td>
                <td>
                    @Html.DisplayForYesNo(item.HasUserGroups)
                </td>
                <td>
                    @Html.DisplayForYesNo(item.IsVisible)
                </td>
                <td>
                    @Html.DisplayForYesNo(item.IsRequired)
                </td>
                <td>
                    @Html.DisplayFor(model => item.SortId)
                </td>
            </tr>
        }
    </tbody>
</table>
